import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

// 路由页面组件（先创建两个示例页面）
const Home = () => import('@/views/Home.vue')
const About = () => import('@/views/About.vue')
const Test = () => import('@/views/Test.vue')

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    component: About
  },
    {
    path: '/test',
    name: 'Test',
    component: Test
  }
]

const router = new VueRouter({
  mode: 'history', // 可选：去掉URL中的#号（需服务器支持）
  base: process.env.BASE_URL,
  routes
})

export default router
